package org.jeecg.modules.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.common.system.base.entity.DelFlagBaseEntity;
import org.jeecgframework.poi.excel.annotation.Excel;

import java.io.Serializable;

/**
 * <p>
 * 菜单权限表
 * </p>
 *
 * @Author scott
 * @since 2018-12-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_permission")
public class SysPermission extends DelFlagBaseEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 父id
	 */
	@Dict(dictTable = "sys_permission", dicText = "name", dicCode = "id")
	@Excel(name = "父类", width = 15, dictTable = "sys_permission", dicText = "name", dicCode = "id")
	private String parentId;

	/**
	 * 菜单名称
	 */
	@Excel(name = "菜单名称", width = 15)
	private String name;

	/**
	 * 菜单权限编码，例如：“sys:schedule:list,sys:schedule:info”,多个逗号隔开
	 */
	@Excel(name = "菜单权限编码", width = 15)
	private String perms;
	/**
	 * 权限策略1显示2禁用
	 */
	@Excel(name = "权限策略1显示2禁用", width = 15)
	private String permsType;

	/**
	 * 菜单图标
	 */
	@Excel(name = "菜单图标", width = 15)
	private String icon;

	/**
	 * 组件
	 */
	@Excel(name = "组件", width = 15)
	private String component;
	
	/**
	 * 组件名字
	 */
	@Excel(name = "组件名字", width = 15)
	private String componentName;

	/**
	 * 路径
	 */
	@Excel(name = "路径", width = 15)
	private String url;
	/**
	 * 一级菜单跳转地址
	 */
	@Excel(name = "一级菜单跳转地址", width = 15)
	private String redirect;

	/**
	 * 菜单排序
	 */
	@Excel(name = "菜单排序", width = 15)
	private Double sortNo;

	/**
	 * 类型（0：一级菜单；1：子菜单 ；2：按钮权限）
	 */
	@Excel(name = "类型", width = 15)
	@Dict(dicCode = "menu_type")
	private Integer menuType;

	/**
	 * 是否叶子节点: 1:是  0:不是
	 */
	@Excel(name = "是否叶子节点", width = 15)
	@TableField(value="is_leaf")
	private boolean leaf;
	
	/**
	 * 是否路由菜单: 0:不是  1:是（默认值1）
	 */
	@Excel(name = "是否路由菜单", width = 15)
	@TableField(value="is_route")
	private boolean route;


	/**
	 * 是否缓存页面: 0:不是  1:是（默认值1）
	 */
	@Excel(name = "是否缓存页面", width = 15)
	@TableField(value="keep_alive")
	private boolean keepAlive;

	/**
	 * 描述
	 */
	@Excel(name = "描述", width = 15)
	private String description;

//	/**
//	 * 删除状态 0正常 1已删除
//	 */
//	private Integer delFlag;
	
	/**
	 * 是否配置菜单的数据权限 1是0否 默认0
	 */
	@Excel(name = "是否配置菜单的数据权限", width = 15)
	private Integer ruleFlag;
	
	/**
	 * 是否隐藏路由菜单: 0否,1是（默认值0）
	 */
	@Excel(name = "是否隐藏路由菜单", width = 15)
	private boolean hidden;
	
	/**按钮权限状态(0无效1有效)*/
	@Excel(name = "按钮权限状态", width = 15)
	private String status;
	
	/**alwaysShow*/
	@Excel(name = "alwaysShow", width = 15)
    private boolean alwaysShow;

	/*update_begin author:wuxianquan date:20190908 for:实体增加字段 */
    /** 外链菜单打开方式 0/内部打开 1/外部打开 */
	@Excel(name = "外链菜单打开方式", width = 15)
    private boolean internalOrExternal;
	/*update_end author:wuxianquan date:20190908 for:实体增加字段 */

    public SysPermission() {
    	
    }
    public SysPermission(boolean index) {
    	if(index) {
    		super.setId("1205097455226462211");
        	this.name="首页";
        	this.component="dashboard/Analysis";
        	this.componentName="dashboard-analysis";
        	this.url="/dashboard/analysis";
        	this.icon="home";
        	this.menuType=0;
        	this.sortNo=0.0;
        	this.ruleFlag=0;
        	this.alwaysShow=false;
        	this.route=true;
        	this.keepAlive=true;
        	this.leaf=true;
        	this.hidden=false;
    	}
    	
    }
}
